package iet.jxufe.cn.android.productanti_counterfeitingtraceabilitysystem.entity;

import java.io.Serializable;
import java.util.Arrays;

public class Product implements Serializable {
    private String productId;
    private String productName;
    private String category;    //产品分类
    private byte[] qrCode;
    private Double price;
    private String produceDate;   //生产日期
    private String manufactureDate;//出厂日期
    private String sellDate;      //销售日期
    private Integer state;
    private byte[] image;   // 产品状态

    public Product(String productName, String category, Double price, String produceDate) {
        this.productName = productName;
        this.category = category;
        this.price = price;
        this.produceDate = produceDate;
    }

    public Product(String productId, String productName, byte[] qrCode, String category, Double price, String produceDate, Integer state) {
        this.productId = productId;
        this.productName = productName;
        this.qrCode = qrCode;
        this.category = category;
        this.price = price;
        this.produceDate = produceDate;
        this.state = state;
    }

    public Product(String productId, String productName, byte[] qrCode, String category, Double price, String produceDate, String manufactureDate, String sellDate, Integer state) {
        this.productId = productId;
        this.productName = productName;
        this.qrCode = qrCode;
        this.category = category;
        this.price = price;
        this.produceDate = produceDate;
        this.manufactureDate = manufactureDate;
        this.sellDate = sellDate;
        this.state = state;
    }

    public Product() {

    }

    public byte[] getImage() {
        return image;
    }

    public void setImage(byte[] image) {
        this.image = image;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getProduceDate() {
        return produceDate;
    }

    public void setProduceDate(String produceDate) {
        this.produceDate = produceDate;
    }

    public String getManufactureDate() {
        return manufactureDate;
    }

    public void setManufactureDate(String manufactureDate) {
        this.manufactureDate = manufactureDate;
    }

    public String getSellDate() {
        return sellDate;
    }

    public void setSellDate(String sellDate) {
        this.sellDate = sellDate;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public byte[] getQrCode() {
        return qrCode;
    }

    public void setQrCode(byte[] qrCode) {
        this.qrCode = qrCode;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Product{" +
                "category='" + category + '\'' +
                ", productId='" + productId + '\'' +
                ", productName='" + productName + '\'' +
                ", qrCode=" + Arrays.toString(qrCode) +
                ", price=" + price +
                ", produceDate='" + produceDate + '\'' +
                ", manufactureDate='" + manufactureDate + '\'' +
                ", sellDate='" + sellDate + '\'' +
                ", state=" + state +
                ", image=" + Arrays.toString(image) +
                '}';
    }
}
